package cn.enjoy.kafka.controller.boot;

import cn.enjoy.kafka.constant.KafkaConstant;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Service;

/**
 * @author K
 * @date 2024-06-30 15:17
 */
@Service
public class Listener {

    /**
     * 必须配置groupId
     * @param message
     */
    @KafkaListener(topics = KafkaConstant.TOPIC_BOOT_TEST, groupId = KafkaConstant.BOOT_GROUP_ID)
    public void consume(String message) {
        System.out.println("Received message: " + message);
    }

}
